home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / dptools / testcurs.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-08  |  1.5 KB  |  76 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <conio.h>
  4.  
  5. struct PointActifStruct { int X, Y; };
  6.  
  7. struct dessin_curseur
  8. { PointActifStruct PointActif;
  9.   unsigned ScreenMask[16];
  10.   unsigned CursorMask[16];
  11. };
  12.  
  13. /* mettre ici les conts */
  14. const dessin_curseur hand = {{0,0},
  15.  {65407,65087,65087,54335,
  16.   32831,32831,32831,15,
  17.   7,7,7,7,
  18.   7,15,15,32783},
  19.  {128,320,320,11072,
  20.   21824,21824,21824,32880,
  21.   32840,32840,32840,32776,
  22.   32776,32784,32784,32752}};
  23. const dessin_curseur tetemort = {{0,0},
  24.  {65535,57359,57335,42011,
  25.   44253,44253,42013,49149,
  26.   54779,57339,57335,57231,
  27.   54655,54655,49279,65535},
  28.  {0,8176,8200,23524,
  29.   21282,21282,23522,16386,
  30.   10756,8196,8200,8304,
  31.   10880,10880,16256,0}};
  32.  
  33. void initmode()
  34. { _AH    =   0x0;
  35.  _AL    =  0x13;
  36.  geninterrupt(0x10);
  37. }
  38. void MontrePointeur()
  39. {
  40.  _AX      =  0x1;
  41.  geninterrupt(0x33);
  42. }
  43.  
  44. int MouseStat(int *Nbbouton)
  45. { int Status;
  46.  _AX       =   0x0;
  47.  geninterrupt(0x33);
  48.  Status    =  _AX;
  49.  *Nbbouton =  _BX;
  50.  return Status;
  51. }
  52.  
  53. void change_Cursor(const dessin_curseur &NewCursor)
  54. { REGS regs;
  55.   SREGS sregs;
  56.   regs.x.ax = 9;
  57.   regs.x.bx = NewCursor.PointActif.X;
  58.   regs.x.cx = NewCursor.PointActif.Y;
  59.   regs.x.dx = FP_OFF(NewCursor.ScreenMask);
  60.   sregs.es  = FP_SEG(NewCursor.ScreenMask);
  61.   int86x(0x33, ®s, ®s, &sregs);
  62. }
  63.  
  64. void main()
  65. {int NbBouton;
  66.  initmode();
  67.  if (MouseStat(&NbBouton))
  68.      {MontrePointeur();
  69.       change_Cursor(hand);
  70.       getch();
  71.       change_Cursor(tetemort);
  72.       getch();
  73.      }
  74. textmode(C80);
  75. }
  76.